#########################################

# mysql头文件存放路径
MYSQLINCL = -I/usr/include/mysql

# mysql库文件保存路径
MYSQLLIB = -L/usr/lib64/mysql

# mysql链接库
MYSQLLIBS = -lmysqlclient

#CFLAGS = -O2
CFLAGS = -O2 -Wall

CFLAGS = -g -w -Wno-write-strings 

all: main mysqltortdb
 
main: main.cpp  tinyxml2.cpp  MD5.cpp rtdbFun.cpp fore_protocol_base.a tcpServer.cpp _mysql.h _mysql.cpp _ccfree.cpp my_mqtt.cpp base.a
	g++ $(CFLAGS) -o main main.cpp tinyxml2.cpp  MD5.cpp rtdbFun.cpp fore_protocol_base.a tcpServer.cpp  _ccfree.cpp my_mqtt.cpp base.a   -I . $(MYSQLINCL) $(MYSQLLIB) $(MYSQLLIBS) _mysql.cpp -lm -lc -L. -ldbms -lpaho-mqtt3a -std=c++11 -lpthread -lrt -fpermissive
 
mysqltortdb: mysqltortdb.cpp _mysql.h _mysql.cpp _ccfree.cpp
	g++ $(CFLAGS) -o mysqltortdb mysqltortdb.cpp _ccfree.cpp -I . $(MYSQLINCL) $(MYSQLLIB) $(MYSQLLIBS) _mysql.cpp -lm -lc -L. -ldbms -std=c++11 -lpthread -lrt -fpermissive

clean:	
	rm -rf main mysqltortdb